home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Comm / mail / SpamFryer.lha / SpamFryer / SpamFryer.text < prev    next >
Text File  |  2004-08-22  |  41KB  |  921 lines

  1. Summary
  2.  
  3. SpamFryer is a small utility which deletes unsolicited emails from
  4. an ISP's server, without you having to download them. Over the six
  5. months before release it has got rid of 85 to 95 per cent of the
  6. spam directed to the author's email accounts, without deleting any
  7. messages he actually wanted to read. That said, your mileage may
  8. vary. SpamFryer is free and you're free to use it or not, at your
  9. own risk.
  10.  
  11. An indexed and hyperlinked version of this document is in the
  12. file SpamFryer.guide. Apart from the links and formatting, the
  13. content of both files is the same. The AmigaGuide version is
  14. for people who prefer to pick their way though an electronic
  15. document. The plain text suits those who prefer to refer to
  16. a printout, or be sure they've read everything.
  17.  
  18. -------------------------------------------------------------
  19.  
  20. Requirements
  21.  
  22. AmiTCP or compatible TCP/IP stack (e.g. Genesis, Miami or Roadshow).
  23.  
  24. An account with Internet Service Provider that offers POP3 email 
  25.   (virtually all do).
  26.  
  27. ARexx (add-on or as bundled by Commodore with Kickstart 2 and 3).
  28.  
  29. A network-capable Amiga (A500 to A4000, or authentic emulation
  30.   e.g. Amithlon, or UAE running a genuine Amiga TCP/IP stack).
  31.  
  32. -------------------------------------------------------------
  33.  
  34. Improvements
  35.  
  36. Version 2:1 rejects more spams, works with more POP3 servers,
  37. generates better reports, runs faster, supports multiple POP3
  38. accounts, and has pretty new icons.
  39.  
  40. Version 3:7 adds the ability to specify rules via 'keep' and
  41. 'lose' lists set in the script or from configuration files.
  42. It can also read account details from a separate file, and
  43. accept passwords interactively if you prefer not to store
  44. them in plain-text on your system. It now works with public
  45. ARexx ports, comes with over 100 rules to sift out good and
  46. bad mails, provides even better reports, and has updated and
  47. improved documentation, as you can probably tell by now. :-)
  48.  
  49. Version 3:9 adds a French translation of the script, two new
  50. rules, and further improvements to the documentation.
  51.  
  52. -------------------------------------------------------------
  53.  
  54. Essential Configuration
  55.  
  56. Before you try to use SpamFryer you need to configure it to access
  57. your internet service provider and email account. If you are unable
  58. to edit a text file, please give up at this stage :-(. Presuming you
  59. know how to edit a text file, and can get hold of your own account
  60. details (I can't help you with this!) there are two ways to do this
  61. - by adding your details to the SpamFryer.accounts file, or embedding
  62. them in the SpamFryer.rexx script. It's simpler to put them in the
  63. SpamFryer.accounts file as long as you don't mind keeping several
  64. SpamFryer files together in one directory.
  65.  
  66. Three bits of information are needed before SpamFryer can log in to
  67. an email account and check for spam on your behalf. One of these,
  68. the password, is optional - if you choose not put it in the text
  69. files (e.g. for security reasons if you are running a server and
  70. allow remote users access to all drives on your machine) SpamFryer
  71. will pop up a requester, requiring you to type in the password
  72. each time it needs access to the relevant account.
  73.  
  74. This information appears in the YAM2 mailer's Settings/Configuration/First
  75. Steps dialogue, and in the yam:.config file (under POP00.Server, POP00.User
  76. and POP00.Password - though the latter is deliberately obscured in the YAM
  77. files, for security reasons). If all else fails, you can get the password,
  78. or a replacement one, from your Internet Service Provider (ISP).
  79.  
  80. Typically you'll include three lines in SpamFryer.accounts for each
  81. POP3 mail account you want SpamFryer to check, e.g.
  82.  
  83.   Hostname: mail.isp.org
  84.   Username: ISP_Account_Name
  85.   Password: guessthis
  86.  
  87. or
  88.  
  89.   Hostname: 194.5.6.7
  90.   Username: JoeBlogs
  91.   Password: tribbles
  92.  
  93. HostName identifies the mail server (the machine that stores emails for
  94. you to collect) on the internet. This can be an IP number e.g. 194.5.6.7
  95. or a domain name like mail.demon.net
  96.  
  97. UserName is the name your computer uses to identify itself, and you, to
  98. the mail server. Typically this is your ISP account name.
  99.  
  100. You can give details of as many accounts as you like. SpamFryer
  101. will check them all, in the order you specify them. The Username
  102. and Hostname for each may come in either order. If you miss out the
  103. password your Amiga will need to be running Workbench 2 or later,
  104. and have reqtools.library and rexxreqtools.library on its LIBS:
  105. path, in order that it can ask for the password interactively.
  106.  
  107. You can put comments in any of the SpamFryer configuration files
  108. (SpamFryer.accounts, SpamFryer.keepList and SpamFryer.loseList)
  109. by starting the line with two slashes and a space, like this:
  110.  
  111. // this is a comment
  112.  
  113. Blank lines are allowed, and ignored.
  114.  
  115. Alternatively, if you'd prefer to keep all your changes in one file
  116. and be able to run SpamFryer without needing other files, add three
  117. lines near the start of the file SpamFryer.rexx, after the comment
  118. /*** CONFIGURATION BLOCK **/ and before the line starting keepList,
  119. as follows:
  120.   
  121.    Account.1.1 =  "mail.isp.net"
  122.    
  123. This can be an IP number e.g. 194.5.6.7 or a domain name like mail.demon.net
  124.  
  125.    Account.1.2 = "yourname"
  126.    
  127. This needs to be your user name - the name your computer uses to identify
  128. itself, and you, to the mail server. Typically this is your ISP account name.
  129.  
  130.    Account.1.3 = "password"
  131.    
  132. This should be the confidential login password you use for email. If you
  133. run any sort of server on your Amiga, you should read this from somewhere
  134. that people logging on to your machine can't access, or they might extract
  135. your password from the SpamFryer script (or any other software you use for
  136. email access). If you make a new version of SpamFryer, remember to remove
  137. this before you send the modified code to anyone else!
  138.  
  139. SpamFryer can check mails from more than one server, and make a log
  140. of what it finds and does on each one. To do this, add additional lines
  141. for other accounts, called Account.2.1, Account.2.2 and Account.2.3 for
  142. the same three items of information listed above for your second server,
  143. and more (e.g. Account.3.1, etc) for as many other accounts as you like.
  144. Alternatively you can put these details in the SpamFryer.accounts file,
  145. or keep some in the file and some in the script - which may be handy if
  146. you want to change part of the configuration (e.g. by renaming several
  147. copies of the accounts file as required) while always checking servers
  148. listed in the script.
  149.  
  150. You may like to adjust the reports SpamFryer generates, to help you
  151. understand and tune what it's doing. If you'd like to try it first,
  152. skip to the next section headed Usage. Otherwise, read on.
  153.  
  154. -------------------------------------------------------------
  155.  
  156. Optional Configuration
  157.  
  158. You don't need to provide any information other than the server and user
  159. names and a password to use SpamFryer. However there are a few other lines,
  160. in the configuration block which you may wish to add or alter to tune
  161. SpamFryer for your system. Of course, you're free to change the whole
  162. script, but the block at the start contains the main configurable ones.
  163.  
  164. Four lines specify files that SpamFryer will attempt to read or write.
  165. You can edit these lines to change the name or location of the files.
  166. The first three are optional data files, presumed to be in the same
  167. directory as the SpamFryer.rexx script unless you alter the assignments
  168. to include an alternative path (e.g. WORK:Secure/SpamFryer.accounts):
  169.  
  170. SpamFryer.keepList is the default path and name of the optional file
  171. which identifies mails you want to keep.
  172.  
  173. SpamFryer.loseList is the default path and name of the optional file
  174. holding details of mails you want to lose.
  175.  
  176. SpamFryer.accounts is the default name of the optional file containing
  177. information used to log in to your POP3 accounts.
  178.  
  179. SpamFryer.log is the output file, normally directed to the T: drive,
  180. which logs what SpamFryer script finds on the server and what it does
  181. as a result. If the verbose variable is set to 1, in the script or by
  182. passing an eponymous argument when the script is called, for instance
  183.  
  184.   rx SpamFryer.rexx VERBOSE
  185.  
  186. The log will contain lots of extra information, including lists of
  187. account details and rules, header information from each mail checked,
  188. and a note on what SpamFryer has done about it. By default the log
  189. file just reports the subject and number of each mail it fries, and
  190. information about errors in the configuration files, with simple
  191. headings. The same information is written to a console window as
  192. the script runs, so you can see what it's doing as it goes along.
  193.  
  194. screenName gives the name of the public screen on which you want
  195. to see a temporary copy of the log as SpamFryer runs - close this
  196. when you've finished with it. The default is '*' which opens a window
  197. on the current screen. lineMax sets the maximum number of characters
  198. of subject lines reported to the screen. Some mails - usually spams -
  199. have very long subjects, so this limits the maximum amount of screen
  200. space such a line can take up.
  201.  
  202. Finally 'noDigits' sets or clears an experimental flag which marks
  203. mails with any numeric digits in their To: address for zapping. Many
  204. spammers make up email addresses for known servers, and if you have
  205. your own domain this rule helps you sift out those non-existent user
  206. names which would otherwise be delivered to your Amiga. BEWARE: This
  207. flag may deleted wanted mails (e.g. if you are cc'd on a mail to an
  208. Yahoo, Freeserve or AOL victim with a human-hostile user name) unless
  209. you apply other rules, e.g. in the keeplist, to make sure mails that
  210. are specifically addressed to you don't get flushed with the spams.
  211.  
  212.  
  213. Miami integration
  214.  
  215. To make SpamFryer run automatically when Miami goes online,
  216. use a MiamiOnline.yam script something like this:
  217.  
  218. miamipath = "WORK:COMMS/MIAMI/Miami"  /* Change this if required */
  219. Spampath = "work:comms/SpamFryer/SpamFryer.rexx" /* Add this line */
  220.  
  221. OPTIONS RESULTS
  222. IF ~SHOW('P', 'MIAMI.1') THEN DO
  223.    ADDRESS COMMAND
  224.    'Run <>NIL:' miamipath
  225.    'WaitForPort MIAMI.1'
  226. END
  227. ADDRESS 'MIAMI.1'
  228. ISONLINE
  229. IF RC=0 THEN ONLINE
  230. ISONLINE
  231. IF RC=0 THEN EXIT 5
  232. HIDE
  233.    ADDRESS COMMAND  /* Added for SpamFryer by Kelvin Graham */
  234.    'rx' Spampath
  235.     'wait 10'
  236.     'endcli'
  237. EXIT 0
  238.  
  239.  
  240. Alternative icons
  241.  
  242. The subdirectory Alternate Icons contains replacements for the default
  243. SpamFryer launch icon. These work the same way but vary in size and
  244. colouring to best suit old and new Amiga systems. The text file in
  245. the same drawer gives more details.
  246.  
  247.  
  248. YAM Support
  249.  
  250. Marcel Beck's YAM (Yet Another Mailer), now open source, is the premier
  251. Amiga email application. Two scripts contributed by users of SpamFryer
  252. are in the subdirectory YAM Support, with plain-text documentation.
  253.  
  254. MiamiOnline.yam modifies the script that launches Miami so that it
  255. also fires up SpamFryer, so your new email is filtered automatically,
  256. as noted above.
  257.  
  258. SpamFryer.yam uses the rules and configuration of SpamFryer.rexx to
  259. scan mails already downloaded and move the likely spams from one
  260. YAM folder to another. It is most useful for those with continuous
  261. and fast internet connections, who do not need to eliminate download
  262. time but still wish to sift spams from their other mail automatically.
  263.  
  264.  
  265. -------------------------------------------------------------
  266.  
  267. Usage
  268.  
  269. You can start SpamFryer by clicking on the supplied icon or with an
  270. AmigaOS command (rx SpamFryer.rexx when SpamFryer.rexx is in the
  271. current directory or on your path). The script has been successfully
  272. tested on AmigaOS 3.0 with Genesis, earlier versions of AmiTCP, Miami
  273. and Roadshow, the new AmigaOS 4 stack. It does not work with the tiny
  274. TCP/IP implementation forwarded from the host by  UAE because that
  275. does not yet implement the AmigaOS TCP: device.
  276.  
  277. You can also configure it to be launched as an ARexx script by Miami,
  278. or run it from the console. One optional parameter 'verbose' makes it
  279. list the details of mails it leaves, as well as those it zaps, in the
  280. console log.
  281.  
  282. You do need to be online and have the ARexx server running when you
  283. start SpamFryer. The easiest way to ensure the latter is to put RexxMast
  284. in your sys:wbstartup directory when you boot your Amiga. ARexx shipped
  285. as a standard component of Commodore's AmigaOS versions 2 and 3.
  286.  
  287. SpamFryer checks through emails on a POP3 host and purges the
  288. unwanted ones by applying simple rules that sift out nine-tenths
  289. of the mass-produced junk mail and attempts by dimwitted PC trojan
  290. and virus programs to mate with Amigas. While these viruses die out
  291. when they reach a real computer (indeed, anything not running Windoze)
  292. they are large, arrive many times over, and are of course useless.
  293.  
  294. SpamFryer shows a summary of waiting messages and deletes any with html
  295. right the start, or subjects or a recipient address known to be bogus.
  296. It includes special sifting for recent Windoze .PIF worms, and mails
  297. flagged by SpamAssassin on the server. It's easy to extend for similar
  298. cases (e.g. new viruses or trojans and mails from particular idiots
  299. who unfortunately have your address) but I find it catches 80..90 per
  300. cent of spams without adding any extra code - if I get a rash of new
  301. spams that it misses I add an extra rule or two.
  302.  
  303. -------------------------------------------------------------
  304.  
  305. Customisation
  306.  
  307. Since SpamFryer is a short plain-text program you can be sure of
  308. what it does and doesn't do, and can easily extend it to do more
  309. - or less, e.g. just report likely spams without deleting them - 
  310. by adding rules to the configuration files, or by editing the
  311. script. If you can do it by editing the configuration, that's
  312. likely to be a lot easier and less risky than editing the script.
  313.  
  314. At first SpamFryer automated the procedure I used to manually
  315. get rid of spams, by printing the commands automatically to
  316. save me typing them, and reading the message headers to find
  317. the sure signs of spam - these include HTML in the first few
  318. lines (i.e. a message with no plain text part); subjects
  319. known to be autogenerated by persistent spamming programs;
  320. mails marked as spam (but not actually deleted) by a server
  321. filter program like SpamAssassin, which was used by Amiga Inc;
  322. mails to any address you've abandoned but which is still
  323. redirected to you,  and emails with .scr and .pif MIME
  324. attachments which are useless on Amigas and generally only
  325. a cause of infection to PCs. If anyone does really need to
  326. send you one of those, ask them to rename it or compress
  327. it into an archive with LHA, LZX, ZIP or whatever so that
  328. SpamFryer doesn't zap the mail.
  329.  
  330. At first SpamFryer only looked for reasons to delete a
  331. mail, and had to be conservative about such rules in case
  332. it accidentally deleted something important. Then Allan
  333. Rasmussen volunteered to add support for rules in separate
  334. files, and for rules that denote a mail that should be kept
  335. rather than lost (sometimes known as a whitelist). This
  336. means that tests can use shorter and more general patterns,
  337. as long as they are effective in identifying spams, as
  338. the risk of losing a wanted mail is reduced 
  339.  
  340. The snag of this is that the whole mail header and
  341. first part of every mail must be read by the script,
  342. in case a later line contains text that indicates the
  343. mail should be kept, despite spam matches earlier.
  344. This slows down the checks, as they can't skip a mail
  345. as soon as it's matched a spam test.
  346.  
  347.  
  348. SpamFryer lists
  349.  
  350. SpamFryer now contains more than 100 rules, in the two
  351. configuration files and in the script itself. Only the
  352. most safe yet effective rules are in the script, where
  353. they are hardest to lose. This means that SpamFryer has
  354. a basic but useful capability without any extra files
  355. (as long as you add your account details to the script).
  356.  
  357. SpamFryer.keepList contains rules that tell SpamFryer about
  358. mails you always want left on the server. These are mails
  359. you never want deleted, even if they contain text that is
  360. typically in junk mail. For instance, mails with SpamFryer
  361. in the checked text are always left on the server (unless
  362. you alter SpamFryer.keeplist to remove the rule) so that
  363. people can quote messages that SpamFryer might delete (for
  364. better or worse) without having their discussion fried!
  365.  
  366. The tests look for references to 'Spam Fryer' (with a
  367. space) as well as SpamFryer (without) in case someone 
  368. prefers to type the name as two words. The rule starts
  369. with the term 'Early-Ref:' so that the entire mail header
  370. and first few lines (up to the point where an HTML-only
  371. message can be identified) are checked for the pattern.
  372. This 'Early-Ref:' category is the slowest test; others
  373. look for certain lines in the mail header and only look
  374. further on the line, trying all the patterns in that
  375. category, providing the first part matches.
  376.  
  377. The first word in the list file tells SpamFryer what part
  378. of the mail to test - the quicker options test the Subject:,
  379. From:, or To: or Reply-To: lines in the header. The colons
  380. and dashes are optional but recommended as they mean the
  381. category names correspond to those used in a mail header.
  382.  
  383. The remainder of each line in the keepList file indicates a
  384. pattern to look for. If that pattern appears anywhere in
  385. the part of the mail specified by the first word, the mail
  386. will be left on the server; it won't be fried even if it
  387. matches rules in the loseList.
  388.  
  389. Rules in the loseList work the same way, except that they
  390. detect patterns which may indicate junk mail, and can be
  391. over-ridden by any rule in the keepList. For this reason,
  392. and because spammers keep trying new scams, there are a
  393. lot more rules in the supplied loseList than there are
  394. in the keepList.
  395.  
  396.  
  397. Safety First
  398.  
  399. You should add your own name and any unpublished email
  400. addresses as 'To:' rules in your own SpamFryer.keepList
  401. to reduce the risk of mails explicitly addressed to you
  402. getting fried.
  403.  
  404. The default keepList contains certain user names which
  405. must be acknowledged by mail to any domain - RFC 2142
  406. (one of the internet standards, informally known as a
  407. 'Request for Comment') says that mails to postmaster,
  408. abuse, security and noc user names (for a server) must
  409. be handled by a human. If you don't own a domain, you
  410. can delete these rules. If you do, it's worth adding
  411. the rest of the address (e.g. abuse@vituperation.org)
  412. to narrow down the default test.
  413.  
  414. A few more default rules let through mails associated
  415. with yahoo group internet mailing lists, and those
  416. associated with Aminet and the YAM Amiga mailer. Add
  417. more rules to suit the lists you subscribe to, unless
  418. you'd prefer to have SpamFryer check those for spam
  419. references - some list servers filter spam well, but
  420. some act annoyingly as spam relays.
  421.  
  422. If you are concerned about the small risk of losing
  423. wanted mails due to the accidental use of terms common
  424. in junk mail, you should check the contents of
  425. SpamFryer.loseList and remove any rules that you
  426. consider might delete things you want to know of.
  427.  
  428. All the rules in that file are there because they
  429. have identified at least four (often many more)
  430. bulk junk mails sent out in the first half of
  431. 2004. But a few people might want unsolicited
  432. information about cable filters (even variously
  433. mis-spelt) penis enlargement or extended warranties,
  434. or might even send mails asking about such things - 
  435. if so they should delete the rules containing those
  436. terms, or they may lose the replies.
  437.  
  438. To be on the safe side, rename SpamFryer.loseList
  439. or move it to another directory until you've made
  440. sure it doesn't exclude any patterns that might be
  441. in mails you want to read. That way the only tests
  442. SpamFryer will perform to identify mails to lose
  443. are for all-HTML mail, those addressed to web (not
  444. email!) addresses, those for undisclosed-recipients
  445. or those marked as spam by SpamAssassin on a server.
  446.  
  447. You can remove those tests by deleting the lines
  448. starting 'CALL lose_rule' in SpamFryer.rexx - but
  449. if you want any of these you probably should not
  450. be using Spam Fryer at all. 8-)
  451.  
  452.  
  453. General rules about rules
  454.  
  455. Comparisons ignore case, so THIS matches thIs and This,
  456. and any line with that word (even THIStle) will match.
  457. If you want to match a specific word, rather than part
  458. of one, put the pattern in 'single ' or " double"
  459. quotes with a space either side (as in the examples)
  460. - however if you have a space both sides you may not
  461. pick up a reference at the start or end of a line.
  462.  
  463. Put // (remember the space) at the start of a line to
  464. temporarily disable a rule without removing it from the
  465. list. Blank lines are ignored, but can make sets clearer.
  466. Before you
  467.  
  468. SpamFryer writes a report showing how many messages it
  469. has killed from each category, and how many it has left
  470. on the server. There will probably still be a few spams
  471. there, but you'll have eliminated most of them by running
  472. SpamFryer before you collect mail in the usual way. As
  473. it's an ARexx script you can automate the process so the
  474. script runs first, whenever your mail client goes to get
  475. new mail - but I leave the details of this to you. :-)
  476.  
  477.  
  478. Editing the source
  479.  
  480. This section is for programmers who want do more than just
  481. add a rule which includes or excludes mails from SpamFryer's
  482. list of things to fry. You will need to understand a bit about
  483. ARexx programming, but not much. ARexx manuals come with Amiga
  484. OS 3.1, A4000s and some earlier Amiga systems. Copious documents
  485. about ARexx are on-line (http://amycoder.hypermart.net/arexx.lha
  486. is a good start) though there's rather less information about
  487. the ARexx interface to TCP/IP - I worked out how to write this
  488. by examining ChkMail (on Aminet) which as written in 1994 by
  489. Matt White <whitem (at) duke (dot) usask (dot) ca> and from basic
  490. knowledge of the POP3 protocol, which I previously used from
  491. an Amiga Shell via telnet to port 110 on my ISP's mail server
  492. (thanks to Peter Corlett for first showing me how to do this).
  493.  
  494. POP3 is a simple plain-text protocol - you send commands like
  495. "user <name>" and "pass <password>" and "stat" to log in and
  496. get a list of messages, then "top <message number> <lines>"
  497. to read back a given number of lines from the chosen message,
  498. and "dele <message number>" to delete it. The protocol is
  499. documented here: http://www.faqs.org/rfcs/rfc1939.html
  500.  
  501. The script can writes messages about the header of each mail
  502. and the reason it is considered spam. If you want to make it
  503. check but not delete anything you can comment out all the lines:
  504.  
  505.    writeln(net,'DELE '||message)
  506.  
  507. by changing them to
  508.  
  509.    /* writeln(net,'DELE '||message) */
  510.  
  511. The comment brackets in ARexx are /* */ just as in C.
  512.  
  513. You can then run the modified script and will see a list
  514. of the things that would have been deleted, but they'll
  515. all still be on the server after the test.
  516.  
  517. SpamFryer uses whatever rules it is programmed to apply by
  518. the configuration files. Be wary of checks that might find
  519. patterns in legitimate mails - the test for CIALIS looks
  520. for a space after that name so it doesn't mistakenly fry
  521. mails with the word 'specialist' in them, for example.
  522.  
  523. To be specific, if the mails you don't want all expect
  524. you to reply to an address medical@hype.net, you can sift
  525. them out like this:
  526.  
  527.          if left(instring,10)='Reply-to: ' then
  528.          do
  529.            if pos('medical@hype.net',instring) >0 then spam=1
  530.          end
  531.  
  532. left(var,num) returns the first (leftmost) num characters of
  533. variable var, so in this case it checks if the line in the
  534. variable instring starts with the 10 characters 'Reply-to: '
  535. and only performs the code between 'do' and 'end' if they
  536. match. If you didn't care about the case of the characters
  537. in this address you'd be far better off adding a REPLY-TO:
  538. rule to SpamFryer.LoseList, but this example shows how to
  539. add a test that requires an ExAcT match.
  540.  
  541. The prewritten tests use the ARexx POS function rather
  542. than exact matches, so a check for .HTM would match
  543. .HTML - and POS("HTM"),inCaps) would match HTM, _Html,
  544. .html, hTm and so on - including Weightman which you
  545. might not want...
  546.  
  547. Combination tests
  548.  
  549. Ad hoc code can be used to add more complex tests than the
  550. keep and lose lists will allow. For instance, messages with
  551. the text "created by women" in the first few lines are
  552. suspect, because a substantial proportion of junk mails
  553. that slipped through the net early in 2004 were from
  554. dating sites which use this phrase as a come-on. Since all
  555. the mails that triggered this also contained the word ' dating '
  556. (with the spaces, so post-dating and carbon-dating would not
  557. match) I set the variable 'dating' to zero before starting to
  558. scan each mail header, and test as follows:
  559.  
  560.     if pos(' DATING ',inCaps) >0 then dating = dating + 1;
  561.     if pos('CREATED BY WOMEN',inCaps) >0 then dating = dating + 1;
  562.  
  563. Then after scanning each mail, I check for at least two such
  564. references, and only zap the mail if the above test triggered
  565. more than once, as follows:
  566.  
  567.   if dating>1 then spam=1
  568.  
  569. You can add more variables for other cases, adjusting the threshold
  570. and the number added for each match, to create conditional rules
  571. that are triggered by a combination of indicators, rather than
  572. just one - although in many cases one indicator is sure enough.
  573.  
  574.  
  575. -------------------------------------------------------------
  576.  
  577. Problems and solutions
  578.  
  579. Check these things first before you email the author for help:
  580.  
  581.   
  582. (0) Remember to put your correct details into the
  583.     configuration block at the start of the script.
  584.     See 'Configuration' above to find out how to do
  585.     this. If you get it wrong you'll get a message
  586.     like this:
  587.     
  588. Error from server: -ERR authorization failed
  589. Command returned 10
  590.  
  591.    or maybe
  592.  
  593. +++ Error 18 in line 197: Invalid argument to function
  594. Command returned 10/18: Invalid argument
  595.  
  596. That message suggests that your setting of Account.1.1
  597. in SpamFryer.rexx, or HOSTNAME: in SpamFryer.accounts,
  598. is incorrect, as the first line that attempts to talk to
  599. the mail server is failing. You may be using the name of
  600. your ISP (e.g. demon.co.uk) rather than their POP3 mail
  601. server (e.g. mail.demon.net, or pop3.demon.co.uk.
  602.  
  603. The line number may vary if the script has been edited,
  604. so check point (2) in this list too if you get Error 18.
  605.  
  606. (1) Make sure you're running ARexx. The shell command
  607.     'rexxmast' should ensure this. If it gives an error
  608.     message, fix that or /no/ ARexx scripts can work
  609.     on your system.
  610.  
  611.  
  612. (2) Make sure you're online - if you get:
  613.  
  614. +++ Error 18 in line 180: Invalid argument to function
  615. Command returned 10/18: Invalid argument to function
  616.  
  617.    or maybe
  618.    
  619. Login [userName]: -ERR not found.
  620.  
  621.   you're not connected to the Internet, or maybe not even
  622.   running a TCP/IP stack! SpamFryer can't work under such
  623.   conditions. Check you can connect to your mail server in
  624.   the usual way, then try to run SpamFryer again while you
  625.   are still online.
  626.  
  627. The line number may vary if the script has been edited,
  628. so check point (0) in this list too if you get Error 18.
  629.  
  630. (3) Configuration error messages
  631.  
  632. SpamFryer attempts to catch all circumstances when errors
  633. in the configuration stop it working properly. Assuming you
  634. have the basics needed to run the script (see above) you
  635. may still get messages if there are errors in the text files
  636. that customise SpamFryer for your system. By default these
  637. files are named SpamFryer.accounts, SpamFryer.keepList and
  638. SpamFryer.loseList.
  639.  
  640. This section lists the error messages and explains their
  641. meanings. Items in brackets vary depending on the
  642. error and other aspects of your configuration
  643.  
  644. ERROR: Unrecognised item [word] in [accountFile]
  645.  
  646.   The first word of a line in the SpamFryer.accounts file
  647.   must be // (for a comment, ignored by the program) or 
  648.   'HOSTNAME:', 'USERNAME:' or 'PASSWORD:' followed by the
  649.   appropriate information for your mail server. If you
  650.   get this message it indicates that the file [accountFile]
  651.   (in the same directory as SpamFryer.rexx unless another
  652.   path is specified) contains a line which starts with
  653.   [word] rather than any of the expected terms.
  654.  
  655. ERROR: No user name configured for host' [hostName] in [AccountFile]
  656.  
  657.   The file [accountFile] specifies a host [hostName] with
  658.   no associated user name for logging in to that host. To
  659.   fix this, add a USERNAME: line with the required name.
  660.           
  661. ERROR: No user name configured for host' [userName] in [AccountFile]
  662.  
  663.   The file [accountFile] specifies an account [userName] but
  664.   contains no line indicating the server for that account. To
  665.   fix this, add a HOSTNAME: line with the required address.
  666.  
  667. ERROR: Duplicate passwords [word1] and  [word2] in [AccountFile]
  668.  
  669.   Two passwords were specified in the file without an intervening
  670.   host and user name. SpamFryer will attempt to use the second one.
  671.   To fix this, remove the redundant line starting with PASSWORD: 
  672.  
  673. ERROR: Password [word] in [AccountFile] needs a host and user name
  674.  
  675.   You have specified a password but no corresponding host or
  676.   user name. To fix this, add a USERNAME: line to indicate the relevant
  677.   account name and a HOSTNAME: followed by the matching server address.
  678.  
  679. ERROR: Rule [line] in SpamFryer.rexx skipped.
  680.  
  681.   The indicated line in the SpamFryer.rexx script (or whatever you
  682.   may have renamed it to) is not understood. Search for the line
  683.   indicated in the message and make sure that it starts with one of
  684.   the correct terms ('TO:', 'FROM:', 'REPLY-TO:', 'SUBJECT:' or
  685.   'EARLY-REF:') to identify a section of the mail to be checked,
  686.   followed by a space and some pattern for SpamFryer to look for
  687.   in that context, on the same line.
  688.  
  689. ERROR in [SpamFryer config file] line [number] skipped.
  690.  
  691.  The number tells you which line of the indicated file, counting
  692.  from 1, cannot be understood by SpamFryer. Search for the line
  693.   indicated in the message and make sure that it starts with one of
  694.   the correct terms ('TO:', 'FROM:', 'REPLY-TO:', 'SUBJECT:' or
  695.   'EARLY-REF:') to identify a section of the mail to be checked,
  696.   followed by a space and some pattern for SpamFryer to look for
  697.   in that context, on the same line.
  698.  
  699.  
  700. (4) UAE and Amiga Forever
  701.  
  702. I use real Amigas, unless I'm writing for people without access
  703. to the genuine article. But the monolithic and unsafe internet
  704. software on most computers has led some people to run AmigaOS
  705. via the excellent UAE emulator. SpamFryer works with UAE, but
  706. requires some extra software to make the host's TCP/IP stack
  707. accessible to scripts.
  708.  
  709. Joe Cosby posted the following question on an Amiga message board:
  710.  
  711. : SpamFryer tries to read from a device TCP:, which I guess must
  712. : be created by the most common Amiga TCP/IP programs.
  713. : This doesn't work under UAE though, there is no TCP: device. I am
  714. : not really sure how UAE handles TCP/IP at all, actually [but] it is
  715. : working for me, I browse the web and download email using AWeb and YAM.
  716. : Does anybody know what, if anything, the equivalent in UAE is, or if
  717. : there is a workaround for this?
  718.  
  719. Thomas Rapp helpfully replied:
  720.  
  721. You need the TCP-Handler program and the TCP mountlist. Get either AmiTCP
  722. or Genesis from Aminet, they should both contain the needed files. Don't
  723. install the archives, only copy the needed files to your System partition.
  724.  
  725. The UAE-Support directory contains files which should be
  726. added to the corresponding directories on the SYS: drive
  727. of a UAE setup, to enable the TCP: device which is used by
  728. SpamFryer and many other fine AmigaOS networking programs.
  729.  
  730. Both files come from the freely-distributable AmiTCP stack,
  731. release 3.0.2b. Please direct all questions about using
  732. UAE to emulator support sites, rather than to the authors
  733. of SpamFryer. If all else fails, get a real Amiga. ;-)
  734.  
  735.  
  736. -------------------------------------------------------------
  737.  
  738. Credits
  739.  
  740. Thanks to the following people for help and feedback
  741. since the first release of SpamFryer. Without them,
  742. there would be no updates on Aminet:
  743.  
  744.   Julian Aronowitz       Paul Juhusz                                                          
  745.    Olaf Barthel           Markus Lunk                                                  
  746.     Fabrizio Bartoloni     Mike McCool           
  747.      Adolf Brunner          Vince Morra            
  748.       Scott Campbell         Harry Patterson 
  749.        Peter Corlett          Thomas Rapp
  750.         Joe Cosby              Allan Rasmussen 
  751.          Herve Dupont           Brian Savage    
  752.           Philippe Ferrucci      Krister Skrtic   
  753.            John Giudice           John Smith              
  754.             Simon Goodwin          Stellan               
  755.              Kelvin Graham          Ivan Teskera              
  756.               Keith Himmelreich      Chris Young   
  757.  
  758. -------------------------------------------------------------
  759.  
  760. History
  761.  
  762. Modified November 2003 to remove personal information
  763.  
  764.         First Aminet upload
  765.  
  766. Modified December 2003 to explicitly QUIT and CLOSE (thanks to Chris Young)
  767.  
  768.         Second Aminet upload
  769.  
  770. Modified January  2004 Verbose argument and multi-account system (by Elwood)
  771.                        Bug fix: multiply-identified spams only get fried once
  772.                        Reports errors and actions to log as well as console
  773.                        Configurable truncation of long console subject lines
  774.                        New check for 'Test, Yep.' Bagle/Beagle worm signature
  775.                        also purges mails 'To: undisclosed-recipients' (SNG)
  776.                        Combines reports for all accounts (Elwood's correction)
  777.                        Junks all mails with the word VIAGRA inside (Stellan)
  778.                        Junks all mails from excite.com (add more?) (Stellan)
  779.                        Skips quickly through headers once spam is identified
  780.                        Explicitly opens the console window - thanks Kelvin!
  781.                        Closes log only after last account (fixes Elwood's fix)
  782.                        POP3 commands end with explicit CR as well as LF (RFC)
  783.                        Junks references to V1agra, Xanax and 'Cialis ' drugs
  784.                        Combination tests sift out unwanted date invitations
  785.                        
  786.         Third Aminet Upload
  787.                      
  788. Modified February 2004 Major updates, most of them made by Allan Rasmussen.
  789.                        Added possibility to use a 'keep' and a 'lose' list.
  790.                        Fixed a minor bug which prevented the Reply-To: field
  791.                        from being scanned properly. I couldn't figure out what
  792.                        the variable 'both' was all about, so I got rid of it
  793.                        and invented a simpler way to produce the final output.
  794.                        Removed the 'bogus address' option, as it is redundant.
  795.                        Made it possible to keep a growing logfile. Made the
  796.                        script compatible with public ARexx ports. Fixed a bug
  797.                        which prevented the second account from being scanned
  798.                        if the first was empty.
  799.  
  800. Modified March/April   Initial keep/lose list update made by Allan Rasmussen.
  801.             2004       Now verbose also works on the log file. Made an offline
  802.                        version of the script for YAM. Verbose argument changed
  803.                        to quiet in the offline YAM version. Simon: Junks mails
  804.                        with the word 'searchingforasoulmate' inside. Allan:
  805.                        Added Early-Ref: argument to the lists. Renamed lists.
  806.                        Simon: removed checks for old worm subjects, added John
  807.                        Smith's patch for optional interactive password entry,
  808.                        added headings for Elwood's multiple account reporting.
  809.                        Symbolic names for constant list indices for readability.
  810.                        Case-independent list pattern handling. No categorisation.
  811.  
  812. Modified May 2004      Call to learn rules. Allow keep and lose list information
  813.                        to be embedded in this program file. Allow comments in list
  814.                        files - such lines must start with "// " (including the
  815.                        space, which the ARexx parser treats as a delimiter).
  816.                        Many new rules. 
  817.  
  818. Modified June 2004     New code to check and report rule effectiveness.
  819.                        Code cleanup, consistent nesting and capitalisation.
  820.                        Allows account details to be read from a file.    
  821.  
  822. Modified July 2004     Option to kill all mail to addresses with digits in.                
  823.                        Now reads other accounts even if first has no mail.
  824.                        Parsing of account file is more robust and error-trapped.
  825.                        Colons after first field in lists are now optional.
  826.                        Quoted pattern support allows leading or trailing spaces.
  827.  
  828.         Fourth Aminet Upload, July 2004
  829.                        
  830. Modified August 2004   Always reports if a list file is not found if that list's
  831.                        name in the script is not null. Rejects mails with both
  832.                        no subject and no 'from' or 'reply-to' address (Elwood).
  833.                        New rule: rejects mails with 'prescription' in subject. 
  834.                        French translation of ARexx added to package (Herve).
  835.                        Clarified integration in SpamFryer.yam.readme (Allan).
  836.                        Missing History file added to the archive.
  837.                        Clarified distribution and translation rules (Simon).
  838.                        
  839.         Fifth Aminet Upload, August 2004               
  840.         
  841. To do (depending on feedback and help from users)
  842.  
  843.                        Implement merged YAM filter and stand-alone script functions
  844.                        Update rules to catch new sorts of spam and to reflect RFCs    
  845.  
  846. -------------------------------------------------------------
  847.  
  848. Distribution
  849.  
  850. SpamFryer is copyright Simon N Goodwin and individual
  851. contributors. It may be freely distributed, without change,
  852. as long as all of the original files in the current Aminet
  853. release are included in the distribution.
  854.  
  855. Nobody is allowed to distribute cut-down, edited, extended
  856. or otherwise modified packages based on SpamFryer, without
  857. the explicit permission of Simon Goodwin.
  858.  
  859. Suggestions for changes and extensions are very welcome. In
  860. general these will be incorporated into the full release
  861. on Aminet.
  862.  
  863. This rule has been made explicit because otherwise there is
  864. a big risk that changes might be made or rules could be added
  865. which substantially increase the chance that mails users want
  866. to keep are inadvertently deleted. Whilst this risk cannot be
  867. avoided in any automatic program, a great deal of effort has
  868. gone into developing, testing and documenting SpamFryer with
  869. a view to minimising such risk.
  870.  
  871. Translations
  872.  
  873. I welcome translations of the script and ideally all the
  874. documentation into any language, to make SpamFryer more
  875. useful to those who are not accustomed to English. But I
  876. am concerned that such changes, unless carefully done and
  877. tested, might make the script less safe for users. I am
  878. also concerned at the extra work involved in keeping many
  879. versions of the script up to date.
  880.  
  881. A translation may not be accepted unless the author is
  882. prepared to maintain it for future releases of SpamFryer.
  883.  
  884. The preferred format for the translation is in the form
  885. of a list of unique English and translated patterns which
  886. can be automatically searched for and replaced, using free
  887. Amiga software, so that fresh translated versions of the
  888. script can be produced from the original English version
  889. with minimal need for manual intervention. Translators
  890. should be prepared to help in the updating of SpamFryer
  891. so that their work is not made obsolete by developments.
  892.  
  893. -------------------------------------------------------------
  894.                                
  895. Contact
  896.  
  897. I hope you like this package, and welcome emails about
  898. it as long as they are constructive and in English, and
  899. not entirely in HTML (or they will be fried as spam ;-).
  900.  
  901. I apologise to those who have been waiting for a long
  902. time for this update, and hope the substantial increase
  903. in features and flexibility explains the delay. The code
  904. of SpamFryer is a lot more complicated than the initial
  905. release, but also more general. I hope that the code is
  906. now feature complete so that (bar bug fixes) any future
  907. release can focus on changes to the keepList and loseList
  908. text files to catch more spams yet avoid losing mails we
  909. would like to keep.
  910.  
  911. My email address is amiga <at> studio <dot> co <dot> uk
  912.  
  913.      Simon N. Goodwin, Warwick UK, August 2004
  914.  
  915. Former Commodore Amiga hardware developer #2202
  916.  Former Commodore Amiga Certified Software developer
  917.   Former Motorola 68060 processor Alpha/Beta tester
  918.    Former columnist, Amiga Format, Amiga User International
  919.     Former Amiga Inc Audio development team leader
  920.      Continuing Amiga A4000/060 user and developer :-)
  921.